//
//  UIButton+Extension.swift
//  SynWeibo
//
//  Created by 沈艳男 on 15/9/11.
//  Copyright © 2015年 沈艳男. All rights reserved.
//

import Foundation
import UIKit

extension UIButton {
    
    /// 便利构造函数
    ///
    /// - parameter title:     title
    /// - parameter imageName: imageName
    /// - parameter color:     color
    /// - parameter fontSize:  fontSize
    ///
    /// - returns: UIButton
    convenience init(title: String, imageName: String, color: UIColor, fontSize: CGFloat) {
        self.init()
        
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
}
